package com.upay.android.controller.activity;

import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.os.Bundle;

import com.upay.android.R;

public abstract class FragmentActivity extends UPayActivity {
    
	/* ---- Constants ---- */
	
	/* ---- Instance Variables ---- */

	/* ---- Constructors ---- */
	
	/* ---- Business Methods ---- */

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_fragment);
    }
    
    public void addFragment(int containerViewId, Fragment fragment) {    	
        getFragmentManager().beginTransaction()
        .add(containerViewId, fragment)
        .commit();
    }
    
    public void replaceFragment(int containerViewId, Fragment fragment) {
    	FragmentManager fragmentManager = getFragmentManager();
        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
        fragmentTransaction.replace(containerViewId, fragment);
        fragmentTransaction.addToBackStack(null);
        fragmentTransaction.commit();
    }
    
}
